/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.mall.pms.domain.bo.spu;

import com.lxk.mall.pms.domain.PmsProductSku;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 商品sku业务对象 pms_product_sku
 *
 * @author Lion Li
 * @date 2024-06-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = PmsProductSku.class, reverseConvertGenerate = false)
public class PmsProductSkuBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * spu编号
     */
    @NotNull(message = "spu编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long spuId;

    /**
     * 商户id
     */
    private Long merId;

    /**
     * 商品类型
     */
    private String productType;

    /**
     * 属性数组，JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]
     */
    @NotBlank(message = "属性数组，JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]不能为空", groups = { AddGroup.class, EditGroup.class })
    private String properties;

    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal price;

    /**
     * 市场价
     */
    @NotNull(message = "市场价不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal marketPrice;

    /**
     * 成本价，单位： 分
     */
    @NotNull(message = "成本价不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal costPrice;

    /**
     * SKU 的条形码
     */
    @NotBlank(message = "SKU 的条形码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String barCode;

    /**
     * 图片地址
     */
    @NotBlank(message = "图片地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String picUrl;

    /**
     * 库存
     */
    @NotNull(message = "库存不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer stock;

    /**
     * 商品重量，单位：kg 千克
     */
    @NotNull(message = "商品重量，单位：kg 千克不能为空", groups = { AddGroup.class, EditGroup.class })
    private Double weight;

    /**
     * 商品体积，单位：m^3 平米
     */
    @NotNull(message = "商品体积，单位：m^3 平米不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long volume;

    /**
     * 一级分销的佣金
     */
    @NotNull(message = "一级分销的佣金不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal firstBrokeragePrice;

    /**
     * 二级分销的佣金
     */
    @NotNull(message = "二级分销的佣金不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal secondBrokeragePrice;

    /**
     * 商品销量
     */
    @NotNull(message = "商品销量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long salesCount;

    /**
     * 锁定库存
     */
    private Integer lockStock;


    /**
     * 积分
     */
    private BigDecimal point;

}
